const { Controller } = require('varal');
const { sequelize } = require('../../models');
const { QueryTypes } = require('sequelize');

class HomeController extends Controller {
	async index() {
		const dictServ = this.app.service('DictionaryService');
		const { root_code, work_id } = this.app.fields;

		const data = await dictServ.get({ root_code, work_id });

		this.app.json({
			err_code: 0,
			data
		});
	}

	async debug() {
		return {};
	}
}

exports = module.exports = HomeController;
